﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

namespace Janus.NorthwindDemo2007
{
	public class CalendarFolder : ApplicationFolder
	{

        private const string cFolderName = "Calendars";

		public CalendarFolder()
		{
			mFolderName = cFolderName;
			this.mSupportedFeatures = FolderFeatures.NewItem;
			this.ImageKey = "Appointments";
            this.EditImageKey = "EditAppointment";
            this.NewImageKey = "NewAppointment";
			this.mLoadMode = FolderLoadMode.Always;
		}


		protected override Type GetTypeOfView(ContentViewType viewType)
		{
			switch (viewType)
			{
				case ContentViewType.ScheduleView:
					return typeof(AppointmentsView);
				default:
					return base.GetTypeOfView(viewType);
			}
		}

		protected override DataProvider CreateDataProvider()
		{
			return new AppointmentsDataProvider();
		}
        public override bool CanAdd
        {
            get
            {
                return true;
            }
        }
		public override void AddNew()
		{
			//call AddNew in the Calendar control that is loaded
			((AppointmentsView)this.CurrentContentView).AddNew();
		}
	}

} //end of root namespace